<extend name="Index/doc" />
<block name="css">
    <link rel="stylesheet" href="__STATIC__/common/editor/css/editormd.css?v=__VERSION__">
    <link rel="stylesheet" href="__STATIC__/doc/css/myeditor.css?v=__VERSION__">
</block>
<block name="main">
    <div class="edit-header clearfix">
        <a href="{:U('/show/'.$doc['id'])}" class="left">{$doc.name}</a>
        <a href="javascript:void(0)" class="right" id="publishBtn" title="发布" data-toggle="modal" data-target="#myModal">发布</a>
        <a href="javascript:void(0)" id="editTitle">{$articleTitle}</a>
    </div>
    <div class="edit-body <if condition='$super eq 1'>toggleCate</if>" id="editBody">
        <if condition="$super eq 1">
            <div class="cate-section">
                <div class="catep">
                    <div class="catep_title">
                        <a href="javascript:void(0)">目录</a>
                    </div>
                    <div class="catep_box" id="cateBox">
                        <li><a href="{:U('/e/'.$doc['id'])}" cid="0"> 写在前面</a></li>
                    </div>
                    <div class="load hide" id="load">
                        <img class="load_img" src="__STATIC__/common/img/load.gif" alt="中转样式">
                    </div>
                </div>
            </div>
        </if>
        <div class="editor" id="editSec">
            <div id="layout" style="height:100%;">
                <div id="editormd" style="margin:0;">
                    <textarea style="display:none;">{$md}</textarea>
                </div>
            </div>
        </div>
    </div>
    <!-- 弹出模态框 -->
    <div class="modal hide" id="modal">
        <div class="modal-container">
            <div class="modal-content">
                <div class="modal-header">
                    <button class="modal-close" id="modalClose"><span>&times;</span></button>
                    <h4 class="modal-title">发布说明</h4>
                </div>
                <div class="modal-body">
                    <div class="form">
                        <div class="form-item">
                            <textarea class="description" id="descZone" spellcheck="false" placeholder="请概述本次文档修改的内容..."></textarea>
                        </div>
                    </div>
                    <p class="edit-tip"> </p>
                </div>
                <div class="modal-footer">
                    <button class="modal-no" id="modalNo">取消</button>
                    <button class="modal-save no-save" id="modalOk">发 布</button>
                </div>
            </div>
        </div>
    </div>
    <form action="{:U('/e/'.$doc['id'].'/c/'.$cid)}" method="post" class="hide" id="editForm">
        <input name="desc" id="desc" type="hidden"/>
        <input name="title" id="title" type="hidden"/>
        <input name="md" id="md" type="hidden"/>
        <if condition="!$needreview"><input name="html" id="html" type="hidden"/></if>
    </form>
    <a href="//doc.wooo.wang/suggest.html" target="_blank" id="bugBtn"><span class="fa red fa-arrow-left" onclick="$(this).parent().toggleClass('bugMark');return false;"></span> 提交BUG</a>
</block>
<block name="js">
    <script src="__STATIC__/common/js/jquery.min.js?v=__VERSION__"></script>
    <script src="__STATIC__/common/editor/editormd.min.js?v=__VERSION__"></script>
    <script>
        var token = '{$token}', superManager = {$super|default = 0}, uid = {:UID}, did = {$doc.id}, cid = {$cid}, editorPath = "__STATIC__/common/editor/lib/";
    </script>
    <script src="__STATIC__/doc/js/edit.js?v=__VERSION__"></script>
    <if condition="$super eq 1">
        <script src="__STATIC__/common/js/jquery.sortable.js?v=__VERSION__"></script>
        <script>
            var cate = {$cate.content|default = "[]"}, count = {$cate.count|default = 0};
        </script>
        <script src="__STATIC__/doc/js/editCate.js?v=__VERSION__"></script>
    </if>
</block>